package main

import (
	"GoSpider/carwler/engine"
	"GoSpider/carwler/persist"
	"GoSpider/carwler/scheduler"
	"GoSpider/carwler/zhenai/parser"
)

func main() {

	items, err := persist.ItemSaver("dating_profile")
	if err != nil {
		panic(err)
	}


	concurrentEngine := engine.ConcurrentEngine{
		Scheduler:   &scheduler.QueuedScheduler{},
		WorkerCount: 80,
		ItemChan:    items,
	}

	concurrentEngine.Run(engine.Request{
		Url:        "http://www.zhenai.com/zhenghun/",
		ParserFunc: parser.ParseCityList,
	})

	//concurrentEngine.Run(engine.Request{
	//	Url:        "http://www.zhenai.com/zhenghun/tianjin",
	//	ParserFunc: parser.ParseCity,
	//})

}
